home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9602 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: mayne.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c,comp.unix.programmer,comp.os.linux.development.apps
  4. Subject: Re: HELP: I/O via LPT1:
  5. Date: 11 Mar 1996 15:13:54 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4i2c3iINNm3u@mayne.ugrad.cs.ubc.ca>
  8. References: <Do2nMH.5A1@ecf.toronto.edu>
  9. NNTP-Posting-Host: mayne.ugrad.cs.ubc.ca
  10.  
  11. In article <Do2nMH.5A1@ecf.toronto.edu>,
  12. BREWSTER  NEIL VINAY <brewste@ecf.toronto.edu> wrote:
  13.  >    I am working on a project which requires that I interface a
  14.  >Linux machine with external circuitry. I have read several faqs (available
  15.  >at www.paranoia.com/~filipg for those interested), and understand how
  16.  >to go about doing this. The only problem is, I do not know the syntax
  17.  >(in C) to do it! The faqs give plenty of examples in assembler, basic,
  18.  >Turbo Pascal, Microsoft C, etc. I am using gcc and the standard libraries...
  19.  
  20. Linux has no "LPT1:"; that is a DOS name. It does have a device driver for the
  21. parallel port. When building a kernel, you conditionally compile this. You
  22. should be able to do what you want by going through the driver---the driver
  23. code is so small you might as well just decipher it directly instead of looking
  24. for documentation.
  25.  
  26. Why don't you ask in a Linux or UNIX newsgroup? This doesn't have much to do
  27. with the C language.
  28.  
  29.  >Does anyone know the equivalent of inport() and outport()?
  30.  
  31. These are not standard C functions. C users on machines that don't have
  32. separate I/O instructions might not even have a clue what ports are.
  33.  
  34.  >Alternatively - is there a way to embed assembler code in a C program?
  35.  
  36. Read the GCC and GAS documentation. Try some GNU-related newsgroups for that,
  37. not comp.lang.c. You shouldn't have to use assembly code unless an existing
  38. device driver is really not suitable for your project.
  39. -- 
  40.  
  41.